﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Sio.Mdm.Entities;

namespace Sio.Mdm.BL.Base
{
    public class BaseSQL<T> : BaseBLGeneric<T> where T: class, IEntity
    {
        public BaseSQL()
            : this(null)
        {
        }
        public BaseSQL(string connecitonName)
            : base(connecitonName)
        {
        }

        protected override System.Data.Common.DbConnection CreateConnection()
        {
            return new SqlConnection(GetConnectionString());
        }

        /*
        protected override System.Data.Common.DbParameter CreateParameter(QueryParameter parameter)
        {
            SqlParameter result = new SqlParameter();

            result.ParameterName = parameter.ParameterName;
            result.Value = parameter.Value;
            result.DbType = parameter.DbType;

            return result;
        }
         */

        protected override System.Data.Common.DbCommand CreateCommand()
        {
            return new SqlCommand();
        }

        protected override void AddParameter(System.Data.Common.DbCommand command, string paramName, object paramValue)
        {
            throw new NotImplementedException();
        }
    }
}
